<?php
namespace app\index\controller;
use think\Model;
use think\Db;

class Goods extends Model{
	
      //自定义初始化
    protected function initialize()
    {
        //需要调用`Model`的`initialize`方法
        parent::initialize();
        //TODO:自定义的初始化
    }

  public function index(){
  	//Db::query('select * from user');

  	//echo Db::table('user')-> select();
    
    //$user = new User();
    //$data = $user -> select();
    // 700 * 20 = 14000  22000 - 14000 = 8000  


  $page = $_REQUEST["page"];
  $id = $_REQUEST["id"];
  
   $goods = new Goods();
   $data = $goods->where('id', '>', $id) -> limit($page)->select();
   // $jsonData = array('data' => $data); 
   //  if($data != NULL){
   //  	return json_encode($jsonData);
   //  }else{

   //  	echo "获取数据NUll";
   //  }
    $jsonData = array('data' => $data); 
    return json_encode($jsonData);
  }

}

?>